package com.leyou.privilege.config;

import com.leyou.privilege.interceptor.PrivilegeHandlerInterceptor;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * Created by IntelliJ IDEA.
 *
 * @author: wangzibeng
 * Date: 2019/5/18 0018
 * Time: 15:25
 */

@Configuration
public class MvcConfig implements WebMvcConfigurer {
    @Autowired
    private JwtProperties properties;

    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new PrivilegeHandlerInterceptor(properties));
    }
}
